home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / vdl020d.zip / VFORM.DOC < prev    next >
Text File  |  1993-04-14  |  7KB  |  261 lines

  1. {
  2.  ═══════════════════════════════════════════════════════════════════════════
  3.  
  4.  Visionix Win/User Interface "Forms" Unit (VFORM)
  5.  Copyright 1991,92,93 Visionix
  6.  ALL RIGHTS RESERVED
  7.  
  8.  Form Tool Library.  It makes it possible to automatically create and use
  9.  a Form for Data Input.
  10.  
  11.  ───────────────────────────────────────────────────────────────────────────
  12.  
  13.  Revision history in reverse chronological order:
  14.  
  15.  Initials  Date      Comment
  16.  --------  --------  -------------------------------------------------------
  17.  
  18.  lpg       03/06/93  Fixed bug with WTextMask Node.  Needed GotoXY()
  19.  
  20.  mep       02/11/93  Cleaned up code for beta release
  21.  
  22.  jrt       02/08/93  Sync with beta 0.12 release
  23.  
  24.  jrt       12/07/92  Sync with beta 0.11 release
  25.  
  26.  jrt       11/21/92  Sync with beta 0.08
  27.  
  28.  
  29.  lpg       10/05/92  Added Support for Float, TxtMask, & NumMask nodes.
  30.                      Increased Node Info Size to 16 Bytes
  31.  
  32.  jrt       09/01/92  First logged revision.
  33.  
  34.  jrt       ??/??/91  Fixed FNT_RadioB fields so they are no longer
  35.                      hardcoded to white on blue
  36.  
  37.  jrt       ??/??/91  Fixed FNT_Opt fields handling of <ESC>
  38.  
  39.  ═══════════════════════════════════════════════════════════════════════════
  40. }
  41.  
  42.  
  43. Unit VForm;
  44.  
  45.  
  46. Uses
  47.  
  48.   VTypes,
  49.   VIn,
  50.   VWinlow,
  51.   VWinhigh,
  52.   VGen,
  53.   VCrt,
  54.   DOS;
  55.  
  56. {────────────────────────────────────────────────────────────────────────────}
  57.  
  58. Const
  59.                    {Form Node Types:       }
  60.   FNT_Master= 1;   { Master Node           }
  61.   FNT_Text  = 2;   { read text node        }
  62.   FNT_Num   = 3;   { read num node         }
  63.   FNT_XBox  = 4;   { check box node        }
  64.   FNT_Opt   = 5;   { readopt field node    }
  65.   FNT_Proc  = 6;   { vendor procedure node }
  66.   FNT_Header= 7;   { text header node      }
  67.   FNT_Button= 8;   { push button node      }
  68.   FNT_RadioB= 9;   { radio button node     }
  69.   FNT_Hex   = 10;  { hex node              }
  70.  
  71.   FNT_Float = 11;  { read float node       }
  72.   FNT_TMask = 12;  { read TxtMask node     }
  73.   FNT_NMask = 13;  { read NumMask node     }
  74.  
  75.   {------------------}
  76.   { FNT_Proc Actions }
  77.   {------------------}
  78.  
  79.   FPA_Draw  = 1;
  80.   FPA_Read  = 2;
  81.  
  82. Type
  83.  
  84.   FNI_Master = RECORD
  85.     NumNodes : WORD;  {number of form nodes}
  86.     HF       : BYTE;  {highlight fore color}
  87.     HB       : BYTE;  {highlight back color}
  88.     F1       : BYTE;  {fore color 1        }
  89.     F2       : BYTE;  {fore color 2        }
  90.     B1       : BYTE;  {back color 1        }
  91.     B2       : BYTE;  {back color 2        }
  92.     {8 bytes to here}
  93.     Resd2    : Array[1..8] of BYTE;
  94.   END;
  95.  
  96.   FNI_Text = RECORD
  97.     Ptr      : POINTER;
  98.     Length   : BYTE;
  99.     Reserved : Array[1..3] of BYTE;
  100.     Rsvd2    : Array[1..8] of BYTE;
  101.   END;
  102.  
  103.   FNI_Header = RECORD
  104.     Ptr      : POINTER;
  105.     Reserved : Array[1..4] of BYTE;
  106.     Rsvd2    : Array[1..8] of BYTE;
  107.   END;
  108.  
  109.   FNI_Num    = RECORD
  110.     Num      : LONGINT;
  111.     Length   : BYTE;
  112.     Reserved : Array[1..3] of BYTE;
  113.     Rsvd2    : Array[1..8] of BYTE;
  114.   END;
  115.  
  116.   FNI_XBox   = RECORD
  117.     Setting  : BOOLEAN;
  118.     Reserved : Array[1..7] of BYTE;
  119.     Rsvd2    : Array[1..8] of BYTE;
  120.   END;
  121.  
  122.   FNI_Button = RECORD
  123.     Ptr      : POINTER;
  124.     BType    : BYTE;
  125.     Key      : BYTE;
  126.     ExtKey   : BYTE;
  127.     Reserved : Array[1..1] of BYTE;
  128.     Rsvd2    : Array[1..8] of BYTE;
  129.   END;
  130.  
  131.   FNI_RadioB = RECORD
  132.     Setting  : BOOLEAN;
  133.     SetPrev  : BYTE;
  134.     SetNext  : BYTE;
  135.     Reserved : Array[1..5] of BYTE;
  136.     Rsvd2    : Array[1..8] of BYTE;
  137.   END;
  138.  
  139.   FNI_Opt    = RECORD
  140.     Ptr      : Pointer;
  141.     NumOpt   : BYTE;
  142.     CurChoice: INTEGER;
  143.     Reserved : BYTE;
  144.     Rsvd2    : Array[1..8] of BYTE;
  145.   END;
  146.  
  147.   FNI_Hex    = RECORD
  148.     Num      : LONGINT;
  149.     Length   : BYTE;
  150.     Reserved : Array[1..3] of BYTE;
  151.     Rsvd2    : Array[1..8] of BYTE;
  152.   END;
  153.  
  154.   FNI_Proc   = RECORD
  155.     Ptr      : Pointer;
  156.     Action   : BYTE;
  157.     Length   : BYTE;
  158.     Reserved : Array[1..2] of BYTE;
  159.     Rsvd2    : Array[1..8] of BYTE;
  160.   END;
  161.  
  162.   FNI_Float  = RECORD  {8 bytes}
  163.     Float    : REAL; {6 bytes}
  164.     Width    : BYTE;
  165.     Decimal  : BYTE;
  166.     Rsvd2    : Array[1..8] of BYTE;
  167.   END;
  168.  
  169.   FNI_TMask  = RECORD  {13 bytes - 5 too many!}
  170.     Mask     : POINTER;
  171.     Keys     : POINTER;
  172.     Fill     : CHAR;
  173.     LJust    : BOOLEAN;
  174.     Txt      : POINTER;
  175.     Rsvd2    : Array[1..2] of BYTE;  {just need 3 bytes here}
  176.   END;
  177.  
  178.   FNI_NMask  = RECORD  {8 bytes}
  179.     Mask     : POINTER;
  180.     Num      : LONGINT;
  181.     Rsvd2    : Array[1..8] of BYTE;
  182.   END;
  183.  
  184.  
  185.   TFormNodeSpecInfo = RECORD
  186.  
  187.     Case INTEGER Of
  188.  
  189.       1 : ( Master : FNI_Master );
  190.       2 : ( Text   : FNI_Text   );
  191.       3 : ( Num    : FNI_Num    );
  192.       4 : ( XBox   : FNI_XBox   );
  193.       5 : ( Opt    : FNI_Opt    );
  194.       6 : ( Proc   : FNI_Proc   );
  195.       7 : ( Header : FNI_Header );
  196.       8 : ( Button : FNI_Button );
  197.       9 : ( RadioB : FNI_RadioB );
  198.      10 : ( Hex    : FNI_Hex    );
  199.      11 : ( Float  : FNI_Float  );
  200.      12 : ( TMask  : FNI_TMask  );
  201.      13 : ( NMask  : FNI_NMask  );
  202.  
  203.     END;
  204.  
  205.   TFormNode = RECORD
  206.  
  207.     T           : WORD;                 { type }
  208.     X           : BYTE;                 { x location }
  209.     Y           : BYTE;                 { Y locatio  }
  210.     F           : INTEGER;              { fore       }
  211.     B           : INTEGER;              { back       }
  212.  
  213.     HF          : INTEGER;
  214.     HB          : INTEGER;
  215.  
  216.     I           : TFormNodeSpecInfo;    { info       }
  217.  
  218.     PrevMajor   : BYTE;
  219.     NextMajor   : BYTE;                 { next major (for pgup/pgdn)   }
  220.  
  221.     GroupAwake  : BOOLEAN;              { if groupmaster, is group up? }
  222.  
  223.     GroupMaster : BYTE;                 { group master for this node   }
  224.  
  225.   END;
  226.  
  227.   PFormNode     = ^TFormNode;
  228.  
  229.   TFormMax      = Array[0..255] of TFormNode;
  230.  
  231.   PFormMax      = ^TFormMax;
  232.  
  233. {────────────────────────────────────────────────────────────────────────────}
  234.  
  235. Procedure WMakeFNode(              Var FN          : TFormNode;
  236.                                        T           : BYTE;
  237.                                        X           : BYTE;
  238.                                        Y           : BYTE;
  239.                                        F           : INTEGER;
  240.                                        B           : INTEGER;
  241.                                        HF          : INTEGER;
  242.                                        HB          : INTEGER;
  243.                                        PrevMajor   : BYTE;
  244.                                        NextMajor   : BYTE;
  245.                                        GroupAwake  : BOOLEAN;
  246.                                        GroupMaster : BYTE       );
  247.  
  248. Procedure WDrawFormNode(               F         : PFormMax;
  249.                                        NodeNum   : BYTE;
  250.                                        UseHigh   : BOOLEAN      );
  251.  
  252. Procedure WDrawForm(                   F         : PFormMax     );
  253.  
  254.  
  255. Procedure WReadForm(                   F          : PFormMax;
  256.                                    Var Cur        : BYTE;
  257.                                    Var ReturnCode : INTEGER     );
  258.  
  259. {────────────────────────────────────────────────────────────────────────────}
  260.  
  261.